<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">


<%@ include file="_head.jsp"%>


<body data-type="widgets">
	<script src="<%=request.getContextPath()%>/static/admin/js/theme.js"></script>
	<div class="am-g tpl-g">
		<!-- 头部 -->
		<%@include file="_header.jsp"%>
		<!-- 风格切换 -->
		<%@include file="_skiner.jsp"%>
		<!-- 侧边导航栏 -->
		<%@include file="_sidebar.jsp"%>
		<!-- 内容区域 -->
		<div class="tpl-content-wrapper">

			<div class="container-fluid am-cf">
				<div class="row">
					<div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
						<div class="page-header-heading">
							<span class="am-icon-home page-header-heading-icon"></span>
							新增博客文章
						</div>
					</div>
				</div>
			</div>

			<div class="row-content am-cf">
				<div class="row">
					<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
						<div class="widget am-cf">
							<div class="widget-body am-fr">
								<form class="am-form tpl-form-line-form" action="articleAdd.do"
									method="post" enctype="multipart/form-data">
									<input type="hidden" name="id" value="${acticle.id }" />
									<input type="hidden" name="coverImg2" value="${acticle.coverImg }" />
									<div class="am-form-group">
										<label for="user-name" class="am-u-sm-3 am-form-label">
											标题 <span class="tpl-form-line-small-title">Title</span> </label>
										<div class="am-u-sm-9">
											<input type="text" class="tpl-form-input" id="title"
												name="title" placeholder="请输入标题文字" value="${acticle.title}">
											<small>请填写标题文字10-20字左右。 </small>
										</div>
									</div>

									<div class="am-form-group">
										<label for="user-name" class="am-u-sm-3 am-form-label">
											作者 <span class="tpl-form-line-small-title">Author</span> </label>
										<div class="am-u-sm-9">
											<input type="text" class="tpl-form-input" id="author"
												name="author" placeholder="请输作者姓名" value="${acticle.author}">
											<small></small>
										</div>
									</div>
									<div class="am-form-group">
										<label for="user-phone" class="am-u-sm-3 am-form-label">
											分类 <span class="tpl-form-line-small-title">Category</span> </label>
										<div class="am-u-sm-9">
											<select data-am-selected="{btnSize: 'sm'}" name="categoryId">
												<c:if test="${categoryId==-1}">
													<option value="-1" selected="selected">所有类别</option>
												</c:if>
												<c:if test="${categoryId!=-1}">
													<option value="-1">所有类别</option>
												</c:if>
												<c:forEach items="${categoryList}" var="category">
													<c:if test="${category.id==categoryId}">
														<option value="${category.id}" selected="selected">${category.title}</option>
													</c:if>
													<c:if test="${category.id!=categoryId}">
														<option value="${category.id}">${category.title}</option>
													</c:if>
												</c:forEach>
											</select>
										</div>
									</div>

									<div class="am-form-group">
										<label class="am-u-sm-3 am-form-label"> 文章描述 <span
											class="tpl-form-line-small-title">Description</span> </label>
										<div class="am-u-sm-9">
											<input type="text" placeholder="输入文章描述 " name="description"
												value="${acticle.description }">
										</div>
									</div>

									<div class="am-form-group">
										<label for="user-weibo" class="am-u-sm-3 am-form-label">
											封面图 <span class="tpl-form-line-small-title">Images</span> </label>
										<div class="am-u-sm-9">
											<input type="file" placeholder="文章封面" name="coverImg" >
										</div>
										<c:if test="${not empty acticle.coverImg }">
											<div class="am-u-sm-9">
												<img
													src="<%=request.getContextPath()%>/${acticle.coverImg }"
													class="tpl-table-line-img" alt="" />
											</div>
										</c:if>
									</div>
									<div class="am-form-group">
										<label for="user-intro" class="am-u-sm-3 am-form-label">文章内容</label>
										<div class="am-u-sm-9">
											<textarea class="" rows="10" id="content" name="content"
												placeholder="请输入文章内容">${acticle.content}</textarea>
										</div>
									</div>
									<div class="am-form-group">
										<div class="am-u-sm-9 am-u-sm-push-3">
											<button type="submit"
												class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%@include file="_footer.jsp"%>
</body>
</html>